package com.xmy.cultivate;

import com.xmy.cultivate.respons.FlowDetailRs;
import com.xmy.cultivate.respons.FlowRs;
import com.xmy.cultivate.service.IAuditFlowDetailService;
import com.xmy.cultivate.service.IAuditFlowService;
import com.xmy.cultivate.util.JsonUtils;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
@Slf4j
public class ErpApplicationTests02 {

    @Autowired
    IAuditFlowService iAuditFlowService;

    @Autowired
    IAuditFlowDetailService iAuditFlowDetailService;

    @Test
    public void test01(){
        //List<FlowRs> flowRsList = iAuditFlowService.getFlowTask(1568138350324350901L,null,null);
        //System.out.println(flowRsList);
        iAuditFlowService.addFlowTask(1874696589063225344L,1568138350324350901L,null,null,null);
    }

    @Test
    public void test02(){
        //List<FlowRs> flowRsList = iAuditFlowService.getFlowTask(1568138350324350901L,null,null);
        //System.out.println(flowRsList);
        iAuditFlowService.completeTask(1874696589063225344L,1600467041876180992L);
    }

    @Test
    public void test03(){
        //List<FlowRs> flowRsList = iAuditFlowService.getFlowTask(1568138350324350901L,null,null);
        //System.out.println(flowRsList);
        //iAuditFlowService.refuseTask(1874696589063225344L,1632175142962462720L);

        FlowDetailRs flowDetailRs = iAuditFlowDetailService.getFlowDetailBySourseId(1874696589063225344L);
        System.out.println(JsonUtils.toJson(flowDetailRs));
    }
}
